﻿CREATE TABLE [dbo].[PropertyMappings] (
    [PropertyMappingId]    BIGINT NOT NULL,
    [IsEditable]           BIT    NOT NULL,
    [IsVisible]            BIT    NOT NULL,
    [IsRequired]           BIT    NOT NULL,
    [PropertyDefinitionId] BIGINT NOT NULL,
    [PrototypedObjectType] BIGINT NOT NULL,
    [PrototypedObjectId]   BIGINT NOT NULL,
    CONSTRAINT [PK_PropertyMappings] PRIMARY KEY CLUSTERED ([PropertyMappingId] ASC),
    CONSTRAINT [FK_PropertyMappings_ObjectTypes] FOREIGN KEY ([PrototypedObjectType]) REFERENCES [dbo].[ObjectTypes] ([ObjectTypeId]),
    CONSTRAINT [FK_PropertyMappings_PropertyDefinitions] FOREIGN KEY ([PropertyDefinitionId]) REFERENCES [dbo].[PropertyDefinitions] ([PropertyDefinitionId])
);

